export const filterFields = (arr, fields) => {
  return arr.map(item => fields.reduce((r, i) => ({
    ...r,
    [i]: item[i]
  }), {}))
}
let totalChart = 'abcdefghijklmiopqrstuvwxyzABCDEFGHIJKLMIOPQRSTUVWXYZ0123456789'
export const getRandomStr = length => {
  return new Array(length).fill('').map(i => totalChart[parseInt(Math.random() * totalChart.length)]).join('')
}
export default {
  filterFields,
  getRandomStr
}